package root.electronclass.electronclass.ext

import root.electronclass.electronclass.common.util.HeadUtil
import com.facebook.drawee.view.SimpleDraweeView

/**
 *
 * @author Lokiy
 * @date 2023/3/20 22:13
 */

/**
 * @param type 0女教师 1男教师 2女学生 3男学生
 */
fun SimpleDraweeView.showAvatar(avatar: String?, type: Int = 1) {
    if (avatar.isNullOrEmpty()) {
        setActualImageResource(HeadUtil.getHeadPic(type))
    } else {
        setImageURI(avatar)
    }
}